# coding:utf-8
from aiobsonrpc import (CreateServer, service_class, request)

HOST_PORT = ('127.0.0.1', 8000)


@service_class
class EchoServer(object):
    @request
    async def swapper(self, txt):
        return f"revers:{''.join(reversed(list(txt)))}"


if __name__ == '__main__':
    # Quick-and-dirty TCP Server:
    server = CreateServer(*HOST_PORT, services=EchoServer())
    server.run()
